package org.example.sudoku;

import android.content.Context;
import android.media.MediaPlayer;

public class Music {

	private static MediaPlayer mp = null;

	public static void play(Context context, int resouceId) {
		stop(context);

		if(Prefs.getMusic(context))
		{
		mp = MediaPlayer.create(context, resouceId);
		mp.setLooping(true);
		mp.start();
		}
	}

	public static void stop(Context content) {
		if (mp != null) {
			mp.stop();
			mp.release();
			mp = null;
		}
	}

}